﻿using ActionLogic;
using BehaviorModel;
using System.Threading;
using CommandLogic.Data;

namespace CommandLogic.Command
{
    public class StartCommand : IQsmCommand
    {
        public CommandData Execute(CommandData data)
        {
            if (ActionExecutor.GetInstance().ActionExecutorState == ActionExecutorState.Stop)
            {
                BlockController.GetInstance().InitBlocks();
                StatisticController.GetInstance().InitStat();
            }

            var thread = new Thread(ActionExecutor.GetInstance().Start) {IsBackground = true};
            thread.Start();

            return null;
        }
    }
}